package org.dtrd.modules.shop.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.shop.entity.bean.GlucometerGetDetail;


/**
 * <p>
 * 血糖仪领用表
 * </p>
 *
 * @author xiao
 * @since 2022-06-29
 */
@Getter
@Setter
@TableName("dtrd_ent_shc_rd_glucometer_get")
public class DtrdEntShcRdGlucometerGet {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 患者ID
     */
    @TableField("patient_id")
    private Integer patientId;

    /**
     * 医生ID
     */
    @TableField("doctor_id")
    private Integer doctorId;

    /**
     * 订单ID
     */
    @TableField("order_id")
    private String orderId;

    /**
     * 扫码时间
     */
    @TableField("scan_time")
    private Date scanTime;

    /**
     * 领取状态：0-未领取，1-已领取，2-已领取未上传
     */
    @TableField("get_status")
    private Integer getStatus;

    /**
     * 旧血糖仪照片
     */
    @TableField("old_glucometer_image")
    private String oldGlucometerImage;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;

    /**
     * 是否删除
     */
    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    public DtrdEntShcRdGlucometerGet init() {
        createTime = new Date();
        isDel = 0;
        return this;
    }

    public DtrdEntShcRdGlucometerGet parseFromDto(GlucometerGetDetail dto) {
        dataId = dto.getDataId();
        patientId = dto.getPatientId();
        doctorId = dto.getDoctorId();
        orderId = dto.getOrderId();
        scanTime = dto.getScanTime();
        getStatus = dto.getGetStatus();
        oldGlucometerImage = dto.getOldGlucometerImage();
        return this;
    }


}
